import requests
from lxml import etree

headers = {
    "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
    "accept-language": "zh-CN,zh;q=0.9",
    "cache-control": "max-age=0",
    "priority": "u=0, i",
    "sec-ch-ua": "\"Google Chrome\";v=\"131\", \"Chromium\";v=\"131\", \"Not_A Brand\";v=\"24\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"Windows\"",
    "sec-fetch-dest": "document",
    "sec-fetch-mode": "navigate",
    "sec-fetch-site": "none",
    "sec-fetch-user": "?1",
    "upgrade-insecure-requests": "1",
    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
}
cookies = {
    "unionJsonOcpc": "eyJvdXRyZWZlcmVyIjoiaHR0cHM6Ly93d3cuYmFpZHUuY29tL290aGVyLnBocD9zYy4wczAwMDBhNXZDVU5hQ1QiLCJwbWNvZGUiOiIxMzc1MzU4MDgiLCJ1dG1fc291cmNlIjoiYmRweiJ9",
    "_uq": "ebfdb3279cf5481fabbac4ec2e361318",
    "local_city_id": "3829",
    "local_city_path": "chengdu",
    "local_city_name": "%E6%88%90%E9%83%BD",
    "uniqid": "d01jbsied3bug",
    "_suq": "89980130-8a58-4ac4-8ad8-90ee2a25c117",
    "oldvid": "",
    "vid": "0b769d676944394711da687f9d1d1d04",
    "Hm_lvt_a360b5a82a7c884376730fbdb8f73be2": "1732867246",
    "HMACCOUNT": "5DDA4B3D76BA6CF5",
    "nsid": "s%3AhGPL4PL3uDEnnnrsSeC12JtzQt2rFKoe.37jd1BTUSZzBah06MDZiRJ4Dhd6VYBmoLeDQ%2FdiqC7I",
    "Hm_lpvt_a360b5a82a7c884376730fbdb8f73be2": "1732867255",
    "vidSended": "1",
    "s_s_c": "xhA3dh7QsA2lgP8ro4tGR5DcQp2Fhvtaw8F%2BEOF%2FWxkSHyvpnRVHFcfxCT8zwrbHx3%2FF%2FCDKCApwUJKEb7SmiQ%3D%3D"
}
url = "https://www.zbj.com/fw/"
params = {
    "k": "saas"
}
response = requests.get(url, headers=headers, cookies=cookies, params=params)

html = etree.HTML(response.text)
print(response.text)
divs = html.xpath('//*[@id="__layout"]/div/div[3]/div[1]/div[4]/div/div[2]/div[1]/div[2]/div')

for div in divs:
    title = div.xpath('./div/div[3]/div[2]/a/span/text()')
    price = div.xpath('./div/div[3]/div[1]/span/text()')
    print(title, price)